-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X.H.Screencorners: Add per monitor hot corners #920
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Pascal Jäger <[email protected]>
link to #919 |
"Great minds think alike"? 😀 |
He sent me the initial feature request 😄 |
Not really, I sent him an email yesterday So to test this I can not really come up with more than "create a bunch of hot corners in every screen corner and edge you have and see if they work". Testing this in an automated way would require simulating screen and whatnot, wouldn't it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
addMonitorCorner :: ScreenCorner -> Int -> Dimension -> X () -> X () | ||
addMonitorCorner corner monitorNumber hotZoneSize xF = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency's sake, I think a version of this with a default size of 1 might be nice
SCLeft -> (x', y' + 150, hotZoneSize', h' - 300) | ||
SCRight -> (x' + w' - hotZoneSize', y' + 150, hotZoneSize', h' - 300) | ||
createWindowAt' (fi xPos) (fi yPos) (fi width) (fi height) | ||
_ -> error $ "Invalid monitor number or no screens available for monitorNumber=" ++ show monitorNumber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this behavior: basically, if I unplug my monitor, and I have a configuration for two monitors, xmonad will throw an error. I suggest that the rules for non-existent monitors are simply ignored
Description
The original implementation of ScreenCorners only allowed hot corners and edges an the corners/ edges of the screen canvas. While this happens to be the same like the corners/ edges of the monitor on a single monitor setup, it is not in a multi monitor setup.
![image](https://private-user-images.githubusercontent.com/85408625/399972884-2c129f4c-ffd6-4aca-a309-9b2d32cf0e9c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODIyNzUsIm5iZiI6MTczOTM4MTk3NSwicGF0aCI6Ii84NTQwODYyNS8zOTk5NzI4ODQtMmMxMjlmNGMtZmZkNi00YWNhLWEzMDktOWIyZDMyY2YwZTljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDE3MzkzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1ZDExNGNmODg1YzFiZGM0Y2M5MTZmNDMyMzZhZWZkZGMyNzRlMTFjMzE2OTIzYmE0ZDM2NGY4ZTIyNDk3YzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Zdf6NCRxGO2kz_pUCvp8QeJwOBl1bOkZqThJdLH4J8A)
See the screenshot below for a visual explanation:
In the screenshot, the light grey area surrounding all the screen is the canvas. The original Screencorners only allowed hot corners to be placed at the corners and edges of that area. So if a monitor position was shifted down in the y axis, like in the screenshot the monitors HDMI-A-0 and DVI-D-1, the upper left corner could never be reached with the mouse. (Same goes for the lower left and upper/ lower screen edges)
My new implementation deprecates but keeps the functions
addScreenCorner
andaddScreenCorners
to not break the existing configuration of users. It adds the functionsaddMonitorCorner
andaddMonitorCorners
which take a screen corner/edge as before and additionally a monitor number and a dimension.With the monitor number it is possible to place hot corners/ edges an a single monitor. The dimension is important, because before the windows that were the hot areas are only 1x1 pixels wide. They are very hard to hit with the mouse if there are on a corner of a screen in the middle.
Usage is now
addMonitorCorner SCUpperLeft 0 20 (spawn "firefox")
and users that were using theaddScreencorner
function before like thisaddScreenCorner SCUpperLeft (spawn "firefox")
can migrate to this usingaddMonitorCorner SCUpperLeft 0 1 (spawn "firefox")
(if monitor 0 is their leftmost monitor)Checklist
I've read CONTRIBUTING.md
I've considered how to best test these changes (property, unit,
manually, ...) and concluded: Create a hot corner in every corner and edge of every monitor and see if they work.
I updated the
CHANGES.md
file